using System;
using Core.Domain.Bases;
using Core.Domain.Enums;

namespace Core.Domain.Entities
{
  ///<summary>
  ///</summary>
  public class Voter : EntityBaseWithId
  {
    public Voter()
    {
    }

    ///<summary>When this ballot was received</summary>
    public virtual DateTime WhenSubmitted { get; set; }

    ///<summary>How the ballot was received</summary>
    public virtual BallotSubmissionMethod BallotSubmissionMethod { get; set; }

    ///<summary>Voting information for this person</summary>
    public virtual Person PersonVoting { get; set; }

    ///<summary>Location where voter is voting</summary>
    public virtual VotingLocation AtLocation { get; set; }

    ///<summary>In this election</summary>
    public virtual Election Election { get; set; }

    ///<summary>Which teller received this ballot from this person</summary>
    public virtual Teller ReceivedByTeller { get; set; }

    public override bool IsValid
    {
      get
      {
        return PersonVoting != null && BallotSubmissionMethod != null;
      }
    }
  }
}